a11y tests: Fix settings that affect a11y output
authorMatthias Clasen <mclasen@redhat.com>
Sat, 18 Jan 2014 15:53:22 +0000 (10:53 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 18 Jan 2014 15:53:22 +0000 (10:53 -0500)
It would be nicer if we could have the tests specify what environment
their expected output was created in, then we could test multiple
scenarios. For now, just fix the setting to avoid test failures.

testsuite/a11y/accessibility-dump.c

index 4cfd51837536a43fdc43df7864055d130b402d1c..2b58ca82648552ba66e92142b49b75d0aff28dad 100644 (file)
@@ -884,12 +884,26 @@ parse_command_line (int *argc, char ***argv)
   return TRUE;
 }
 
+static void
+fix_settings (void)
+{
+  /* Some settings can affect the output of the accessibility tests,
+   * so we take some steps to isolate us from the ambient environment.
+   */
+
+  g_object_set (gtk_settings_get_default (),
+                "gtk-dialogs-use-header", TRUE,
+                NULL);
+}
+
 int
 main (int argc, char **argv)
 {
   if (!parse_command_line (&argc, &argv))
     return 1;
 
+  fix_settings ();
+
   if (argc < 2)
     {
       const char *basedir;